const Router = require('koa-router')
const { Success } = require('../../core/http-exception')
const { Auth } = require('../../core/middleware/auth')
const { Order } = require('../../models/order')
const router = new Router({
    prefix: '/v1/exchange',
})
router.post('/addOrder', new Auth().m, async (ctx, next) => {
    const res = await Order.addList(ctx.request.body.id, ctx.auth.id)
    ctx.body = {
        code: res ? 200 : 408,
        data: res,
        msg: '积分不够哦!'
    }
})
module.exports = router

